package lab02.test04;

/**
 * Created by 婷婷 on 2017/10/15.
 */
public class Staff {
    //属性:分别是员工姓名，号码，基本薪资，薪资增长额,
    private String name;
    private long num;
    private int basicSalary;
    private float wageGrowth;

    //构造函数
    public Staff(String name, long num, int basicSalary, float wageGrowth) {
        this.name = name;
        this.num = num;
        this.basicSalary = basicSalary;
        this.wageGrowth = wageGrowth;
    }

    //方法

    //获取员工姓名的方法
    public String name () {
        return name;
    }

    //获取员工电话号码的方法
    public long num () {
        return num;
    }

    //获取员工基本薪资的方法
    public int basicSalary() {
        return basicSalary;
    }

    //获取员工薪资增长额的方法
    public float wageGrowth() {
        return wageGrowth;
    }

    //获取员工工资增长后总工资的方法
    public float totalWagesAfterGrowth(){
        float totalWagesAfterGrowth = (1+wageGrowth)*basicSalary;
        return totalWagesAfterGrowth;
    }

    /**
     * 返回需要的员工信息
     * @return
     */
    @Override
    public String toString() {
        String staffInfon = "员工的姓名："+name()+"\n员工的号码："+num()+"\n员工的基本薪资："+basicSalary()+"\n员工的薪资增长率："
                +wageGrowth()+"\n员工的薪资增长后的总额："+totalWagesAfterGrowth();
        //返回转换成字符串后的信息
        return staffInfon;
    }
}
